
class BikeInfoM {
  BikeInfoM({
      this.bikeInfo, 
      this.statusInfo, 
      this.feeInfo, 
      this.gpsInfo, 
      this.bmsInfo, 
      this.bikeUseStatus,});

  BikeInfoM.fromJson(dynamic json) {
    bikeInfo = json['bike_info'] != null ? BikeInfo.fromJson(json['bike_info']) : null;
    statusInfo = json['status_info'] != null ? StatusInfo.fromJson(json['status_info']) : null;
    feeInfo = json['fee_info'] != null ? FeeInfo.fromJson(json['fee_info']) : null;
    gpsInfo = json['gps_info'] != null ? GpsInfo.fromJson(json['gps_info']) : null;
    bmsInfo = json['bms_info'] != null ? BmsInfo.fromJson(json['bms_info']) : null;
    bikeUseStatus = json['bike_use_status'] != null ? BikeUseStatus.fromJson(json['bike_use_status']) : null;
  }
  BikeInfo? bikeInfo;
  StatusInfo? statusInfo;
  FeeInfo? feeInfo;
  GpsInfo? gpsInfo;
  BmsInfo? bmsInfo;
  BikeUseStatus? bikeUseStatus;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (bikeInfo != null) {
      map['bike_info'] = bikeInfo?.toJson();
    }
    if (statusInfo != null) {
      map['status_info'] = statusInfo?.toJson();
    }
    if (feeInfo != null) {
      map['fee_info'] = feeInfo?.toJson();
    }
    if (gpsInfo != null) {
      map['gps_info'] = gpsInfo?.toJson();
    }
    if (bmsInfo != null) {
      map['bms_info'] = bmsInfo?.toJson();
    }
    if (bikeUseStatus != null) {
      map['bike_use_status'] = bikeUseStatus?.toJson();
    }
    return map;
  }

}

class BikeInfo {
  BikeInfo({
    this.id,
    this.version,
    this.deviceType,
    this.model,
    this.definedAreaId,
    this.areaId,
    this.brandCode,
    this.areaName,
    this.isAiReturn,
    this.aiReturnConf,
    this.centralManufacturerId,
    this.realSn,
    this.isNavigation,
    this.helmetDisinfect,
    this.helmetInstalled,
    this.isSetOneKeyOn,
    this.isAiotleReturn,
    this.aiotleReturnConf,
    this.cameraReturnType,
    this.dispatchState,
    this.isSupportAiSensing,
    this.spAreaCode,});

  BikeInfo.fromJson(dynamic json) {
    id = json['id'];
    version = json['version'];
    deviceType = json['device_type'];
    model = json['model'];
    definedAreaId = json['defined_area_id'];
    areaId = json['area_id'];
    brandCode = json['brand_code'];
    areaName = json['area_name'];
    isAiReturn = json['is_ai_return'];
    aiReturnConf = json['ai_return_conf'];
    centralManufacturerId = json['central_manufacturer_id'];
    realSn = json['real_sn'];
    isNavigation = json['is_navigation'];
    helmetDisinfect = json['helmet_disinfect'];
    helmetInstalled = json['helmet_installed'];
    isSetOneKeyOn = json['is_set_one_key_on'];
    isAiotleReturn = json['is_aiotle_return'];
    aiotleReturnConf = json['aiotle_return_conf'];
    cameraReturnType = json['camera_return_type'];
    dispatchState = json['dispatch_state'];
    isSupportAiSensing = json['is_support_ai_sensing'];
    spAreaCode = json['sp_area_code'];
  }
  String? id;
  String? version;
  num? deviceType;
  String? model;
  String? definedAreaId;
  String? areaId;
  String? brandCode;
  String? areaName;
  num? isAiReturn;
  String? aiReturnConf;
  String? centralManufacturerId;
  String? realSn;
  num? isNavigation;
  num? helmetDisinfect;
  num? helmetInstalled;
  num? isSetOneKeyOn;
  num? isAiotleReturn;
  String? aiotleReturnConf;
  num? cameraReturnType;
  num? dispatchState;
  num? isSupportAiSensing;
  String? spAreaCode;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['version'] = version;
    map['device_type'] = deviceType;
    map['model'] = model;
    map['defined_area_id'] = definedAreaId;
    map['area_id'] = areaId;
    map['brand_code'] = brandCode;
    map['area_name'] = areaName;
    map['is_ai_return'] = isAiReturn;
    map['ai_return_conf'] = aiReturnConf;
    map['central_manufacturer_id'] = centralManufacturerId;
    map['real_sn'] = realSn;
    map['is_navigation'] = isNavigation;
    map['helmet_disinfect'] = helmetDisinfect;
    map['helmet_installed'] = helmetInstalled;
    map['is_set_one_key_on'] = isSetOneKeyOn;
    map['is_aiotle_return'] = isAiotleReturn;
    map['aiotle_return_conf'] = aiotleReturnConf;
    map['camera_return_type'] = cameraReturnType;
    map['dispatch_state'] = dispatchState;
    map['is_support_ai_sensing'] = isSupportAiSensing;
    map['sp_area_code'] = spAreaCode;
    return map;
  }

}


class BikeUseStatus {
  BikeUseStatus({
    this.isSocFix,
    this.isGpsFix,
    this.riddingMile,
    this.isHelmetFix,
    this.isHasHelmet,
    this.isPrePay,
    this.helmetUrl,
    this.useState,
    this.isRequireHelmetRiding,
    this.dispatchState,});

  BikeUseStatus.fromJson(dynamic json) {
    isSocFix = json['is_soc_fix'];
    isGpsFix = json['is_gps_fix'];
    riddingMile = json['ridding_mile'];
    isHelmetFix = json['is_helmet_fix'];
    isHasHelmet = json['is_has_helmet'];
    isPrePay = json['is_pre_pay'];
    helmetUrl = json['helmet_url'];
    useState = json['use_state'];
    isRequireHelmetRiding = json['is_require_helmet_riding'];
    dispatchState = json['dispatch_state'];
  }
  num? isSocFix;
  num? isGpsFix;
  num? riddingMile;
  num? isHelmetFix;
  num? isHasHelmet;
  num? isPrePay;
  String? helmetUrl;
  num? useState;
  num? isRequireHelmetRiding;
  num? dispatchState;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['is_soc_fix'] = isSocFix;
    map['is_gps_fix'] = isGpsFix;
    map['ridding_mile'] = riddingMile;
    map['is_helmet_fix'] = isHelmetFix;
    map['is_has_helmet'] = isHasHelmet;
    map['is_pre_pay'] = isPrePay;
    map['helmet_url'] = helmetUrl;
    map['use_state'] = useState;
    map['is_require_helmet_riding'] = isRequireHelmetRiding;
    map['dispatch_state'] = dispatchState;
    return map;
  }

}

class BmsInfo {
  BmsInfo({
    this.mosTemp,
    this.fault,
    this.soc,
    this.voltage,
    this.current,
    this.timestamp,});

  BmsInfo.fromJson(dynamic json) {
    mosTemp = json['mos_temp'];
    fault = json['fault'];
    soc = json['soc'];
    voltage = json['voltage'];
    current = json['current'];
    timestamp = json['timestamp'];
  }
  num? mosTemp;
  num? fault;
  num? soc;
  num? voltage;
  num? current;
  num? timestamp;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['mos_temp'] = mosTemp;
    map['fault'] = fault;
    map['soc'] = soc;
    map['voltage'] = voltage;
    map['current'] = current;
    map['timestamp'] = timestamp;
    return map;
  }

}

class FeeInfo {
  FeeInfo({
    required this.startPrice,
    required this.startMin,
    required this.everyMin,
    required this.everyPrice,
    required this.maxPrice,
    required this.useFreeTimeSec,
    required this.freeTime,
    required this.freeTimeSec,
    required this.trafficFare,
    required this.serviceOutwardFee,
    required this.nostopOutwardFee,
    required this.forbiddenSoc,
    required this.unitPrice,
    required this.fullPrice,});

  FeeInfo.fromJson(dynamic json) {
    startPrice = json['start_price']??0;
    startMin = json['start_min']??0;
    everyMin = json['every_min']??0;
    everyPrice = json['every_price']??0;
    maxPrice = json['max_price']??0;
    useFreeTimeSec = json['use_free_time_sec']??0;
    freeTime = json['free_time']??0;
    freeTimeSec = json['free_time_sec']??0;
    trafficFare = json['traffic_fare']??0;
    serviceOutwardFee = json['service_outward_fee']??0;
    nostopOutwardFee = json['nostop_outward_fee']??0;
    forbiddenSoc = json['forbidden_soc']??0;
    unitPrice = json['unit_price']??0;
    fullPrice = json['full_price']??0;
  }
  late num startPrice;
  late num startMin;
  late num everyMin;
  late num everyPrice;
  late num maxPrice;
  late num useFreeTimeSec;
  late num freeTime;
  late num freeTimeSec;
  late num trafficFare;
  late num serviceOutwardFee;
  late num nostopOutwardFee;
  late num forbiddenSoc;
  late num unitPrice;
  late num fullPrice;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['start_price'] = startPrice;
    map['start_min'] = startMin;
    map['every_min'] = everyMin;
    map['every_price'] = everyPrice;
    map['max_price'] = maxPrice;
    map['use_free_time_sec'] = useFreeTimeSec;
    map['free_time'] = freeTime;
    map['free_time_sec'] = freeTimeSec;
    map['traffic_fare'] = trafficFare;
    map['service_outward_fee'] = serviceOutwardFee;
    map['nostop_outward_fee'] = nostopOutwardFee;
    map['forbidden_soc'] = forbiddenSoc;
    map['unit_price'] = unitPrice;
    map['full_price'] = fullPrice;
    return map;
  }

}

class GpsInfo {
  GpsInfo({
    this.lat,
    this.lng,
    this.voltage,
    this.speed,
    this.course,
    this.hdop,
    this.satellite,
    this.totalMiles,});

  GpsInfo.fromJson(dynamic json) {
    lat = json['lat'];
    lng = json['lng'];
    voltage = json['voltage'];
    speed = json['speed'];
    course = json['course'];
    hdop = json['hdop'];
    satellite = json['satellite'];
    totalMiles = json['total_miles'];
  }
  num? lat;
  num? lng;
  num? voltage;
  num? speed;
  num? course;
  num? hdop;
  num? satellite;
  num? totalMiles;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['lat'] = lat;
    map['lng'] = lng;
    map['voltage'] = voltage;
    map['speed'] = speed;
    map['course'] = course;
    map['hdop'] = hdop;
    map['satellite'] = satellite;
    map['total_miles'] = totalMiles;
    return map;
  }

}


class StatusInfo {
  StatusInfo({
    this.isOnline,
    this.isRiding,
    this.isAppointment,
    this.appointmentUserId,
    this.isFault,});

  StatusInfo.fromJson(dynamic json) {
    isOnline = json['is_online'];
    isRiding = json['is_riding'];
    isAppointment = json['is_appointment'];
    appointmentUserId = json['appointment_user_id'];
    isFault = json['is_fault'];
  }
  num? isOnline;
  num? isRiding;
  num? isAppointment;
  String? appointmentUserId;
  num? isFault;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['is_online'] = isOnline;
    map['is_riding'] = isRiding;
    map['is_appointment'] = isAppointment;
    map['appointment_user_id'] = appointmentUserId;
    map['is_fault'] = isFault;
    return map;
  }

}